<template>
  <h1>App</h1>
    <bread :data="data" seprator="(●'◡'●)"></bread>
  <router-view  ></router-view>
</template>
<script setup>
import {ref,getCurrentInstance,onMounted} from "vue"
let data=ref([])

//1.在setup中如何使用eventbus
//2.reactive声明的变量重新赋值，丢失响应
//3.如何获取全局的properties
onMounted(()=>{
  //获取组件当前的实例
  let instance=getCurrentInstance()
  // console.log(getCurrentInstance());

  //获取app全局添加的$bus属性
  let $bus=instance.appContext.config.globalProperties.$bus

  $bus.$on('bread',input=>{
    console.log(input);

    data.value=input
  })
})

</script>
